import { createRouter, createWebHistory } from 'vue-router'

//导入组件
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'

import ArticleCategoryVue from '@/views/article/ArticleCategory.vue'
import DepartmentComparisonVue from '@/views/verify/DepartmentComparison.vue'
import ArticleManageVue from '@/views/article/ArticleManage.vue'
import UserAvatarVue from '@/views/user/UserAvatar.vue'
import UserInfoVue from '@/views/user/UserInfo.vue'
import LeaderManageVue from '@/views/UserManage/LeaderManage.vue'
import FarmerManageVue from '@/views/UserManage/FarmerManage.vue'
import HelpmanManageVue from '@/views/UserManage/HelpmanManage.vue'
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue'
import IntensiveMonitorVue from '@/views/monitor/IntensiveMonitor.vue'
import RiskManageVue from '@/views/SystemManage/RiskManage.vue'
import HelpManageVue from '@/views/SystemManage/HelpManage.vue'
import VillageApprovalVue from '@/views/approval/VillageApproval.vue'
import TownApprovalVue from '@/views/approval/TownApproval.vue'
import CountyApprovalVue from "@/views/approval/CountyApproval.vue"
import CityApprovalVue from "@/views/approval/CityApproval.vue";
import ProvinceApprovalVue from "@/views/approval/ProvinceApproval.vue";
import BackApprovalVue from "@/views/approval/BackApproval.vue";
import OverallVue from '@/views/stats/Overall.vue'
import ClueVue from '@/views/stats/ClueClassify.vue'
import HandlingVue from '@/views/stats/Handling.vue'
import MapVue from '@/views/stats/all/Map.vue'
import ApplypoorVue from '@/views/farmer/applypoor.vue'
import HelpVue from '@/views/farmer/Help.vue'

//定义路由关系
const routes = [
    { path: '/login', component: LoginVue },
    {
        path: '/', component: LayoutVue,redirect:'/stats/overall',children: [
            { path: '/article/category', component: ArticleCategoryVue,meta:{title:'文章分类'}},
            { path: '/article/manage', component: ArticleManageVue,meta:{title:'文章管理'}},
            { path: '/farmer/applypoor', component: ApplypoorVue,meta:{title:'风险来源 / 农户主动申请'}},
            { path: '/farmer/Help', component: HelpVue,meta:{title:'帮扶安排 / 帮扶安排'}},
            { path: '/verify/department', component: DepartmentComparisonVue,meta:{title:'风险来源 / 部门信息对比'}},
            { path: '/user/info', component: UserInfoVue },
            { path: '/user/avatar', component: UserAvatarVue },
            { path: '/user/resetPassword', component: UserResetPasswordVue },
            { path: '/approval/back', component: BackApprovalVue,meta:{title:'核实处理 / 打回审批'}},
            { path: '/approval/village', component: VillageApprovalVue,meta:{title:'核实处理 / 村级审批'}},
            { path: '/approval/town', component: TownApprovalVue,meta:{title:'核实处理 / 乡级审批'}},
            { path: '/approval/county', component: CountyApprovalVue,meta:{title:'核实处理 / 县级审批'}},
            { path: '/approval/city', component: CityApprovalVue,meta:{title:'核实处理 / 市级审批'}},
            { path: '/approval/province', component: ProvinceApprovalVue,meta:{title:'核实处理 / 省级审批'}},
            { path: '/UserManage/leader', component: LeaderManageVue,meta:{title:'用户管理 / 干部管理'}},
            { path: '/UserManage/farmer', component: FarmerManageVue,meta:{title:'用户管理 / 农户管理'}},
            { path: '/UserManage/helpman', component: HelpmanManageVue,meta:{title:'用户管理 / 帮扶人管理'}},
            { path: '/monitor/IntensiveMonitor', component: IntensiveMonitorVue,meta:{title:'监测管理'}},
            { path: '/SystemManage/RiskManage', component: RiskManageVue,meta:{title:'系统管理 / 风险点管理'}},
            { path: '/SystemManage/HelpManage', component: HelpManageVue,meta:{title:'系统管理 / 帮扶措施管理'}},
            { path: '/stats/overall', component: OverallVue ,meta:{title:'预警统计分析 / 总体情况分析'}},
            { path: '/stats/clue', component: ClueVue ,meta:{title:'预警统计分析 / 线索类型分析'}},
            { path: '/stats/handling', component: HandlingVue ,meta:{title:'预警统计分析 / 处理情况分析'}},
            { path: '/stats/all/map', component: MapVue }]
    }

]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

//导出路由
export default router
